<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var reg = /admin/;
    console.log(reg.test('1admin'));    // 输出结果：true
    console.log(reg.test('address'));   // 输出结果：false

    var reg = /a.min/;
    // 输出结果：["admin", index: 1, input: "1admin2admin", groups: undefined]
    console.log('1admin2admin'.match(reg));
    // 输出结果：null
    console.log('address'.match(reg));

    var reg = /a.s/g;
    var str = 'abs abc ads abd ass amas';
    // 输出结果：(3) ["abs", "ads", "ass"]
    console.log(str.match(reg));
  </script>
</body>
</html>